package com.itheima.apidemo;
/*
System arrayCopy
 */
public class Demo02 {


    public static void main(String[] args) {
        int[] arr= {11,22,33,44,55};
        int i=66;
        int[] newArr = new int[arr.length + 1];
        System.arraycopy(arr,0,newArr,0,arr.length);
        newArr[arr.length]=i;
        for (int i1 = 0; i1 < newArr.length; i1++) {
            System.out.println(newArr[i1]);
        }
        int[] brr={11,22,33,44,55};
        //删除33; 2上
        //brr[2]=0;
        System.arraycopy(brr,2+1,brr,2,arr.length-2-1);
        brr[brr.length-1]=0;
        for (int i1 = 0; i1 < brr.length; i1++) {
            System.out.println(brr[i1]);
        }

    }
}
